import gulp from 'gulp';
import gulpif from 'gulp-if';
import liveServer from 'gulp-live-server';
import args from './utils/args';
gulp.task('serve', (cb) => {
  if (!args.watch) return cb();
  let server = liveServer.new(['--harmony', 'server/bin/www'])
  server.start();
  gulp.watch(['server/public/**/*.js', 'server/views/**/*.ejs'], function (file) {
    server.notify.apply(server, [file])
  })
  gulp.watch(['server/routes/**/*.js', 'server/app.js'], function () {
    server.start.bind(server)()
  })
})